#ifndef _CRITSEC_H
#define _CRITSEC_H

#include<windows.h>

class sCriticalSection
{
private:
	
	CRITICAL_SECTION CritSec;


public:
	
	sCriticalSection()
		{
			InitializeCriticalSection(&CritSec);
		}

	void Lock()
		{
			EnterCriticalSection(&CritSec);
		}

	void Unlock()
		{
			LeaveCriticalSection(&CritSec);
		}

	~sCriticalSection()
		{
			DeleteCriticalSection(&CritSec);
		}

};

#endif